﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMES.IServices.Testingitemes;
using System.Threading.Tasks;
using VOL.Core.Utilities.Response;
using VOL.Entity.DomainModels.Core;
using VOL.Entity.DomainModels;

namespace VOL.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TestingitemsController : ControllerBase
    {
        private readonly ITestingitemsServices _testingitemsServices;

        public TestingitemsController(ITestingitemsServices testingitemsServices)
        {
            _testingitemsServices = testingitemsServices;
        }
        [HttpPost("AddTestingitems")]
        public async Task<ActionResult<WebResponseContent>> Add([FromBody] testingitems Testingitems)
        {
            return await _testingitemsServices.AddTestingitemsModel(Testingitems);
        }
        [HttpPost("UpdateTestingitems")]
        public async Task<ActionResult<WebResponseContent>> Update([FromBody] testingitems Testingitems)
        {
            return await _testingitemsServices.UpdateTestingitemsModel(Testingitems);
        }
        [HttpPost("DelTestingitems")]
        public async Task<ActionResult<WebResponseContent>> Delete([FromBody] testingitems Testingitems)
        {
            return await _testingitemsServices.DelTestingitemsModel(Testingitems);
        }
        [HttpGet("GetTestingitems")]
        public async Task<PageGridData<testingitems>> GetList([FromQuery] string? PlanNo, int pageIndex = 1, int pageSize = 5)
        {
            return await _testingitemsServices.GetTestingitems(PlanNo,pageIndex, pageSize);
        }
    }
}
